using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Backend.JYD.Model.Cust;
using Backend.JYD.Model;

namespace Backend.JYD.BLL.Cust
{
    public class CustPhoneBLL
    {
        private static readonly IDAL.Cust.ICustPhone idal = Factory.DALFactory.CreateEFDAL<IDAL.Cust.ICustPhone>("DAL.CustPhoneDAL");

        public List<CustPhone> GetCustPhoneByCustNo(string custNo)
        {
            if (string.IsNullOrWhiteSpace(custNo)) return null;
            return idal.GetCustPhoneByCustNo(custNo);
        }
        public List<CustPhone> GetCustPhoneByPhone(string phone)
        {
            if (string.IsNullOrWhiteSpace(phone)) return null;
            return idal.GetCustPhoneByPhone(phone);
        }

        public bool CheckCustPhone(string custNo, string phone)
        {
            if (string.IsNullOrWhiteSpace(custNo) || string.IsNullOrWhiteSpace(phone)) return false;
            return idal.CheckCustPhone(custNo, phone);
        }
        public bool AddCustPhone(CustPhone info)
        {
            if (string.IsNullOrWhiteSpace(info.CustNo) || string.IsNullOrWhiteSpace(info.Phone)) return false;
            return idal.AddCustPhone(info);
        }
    }
}
